package doujian.filter.rules;

import doujian.model.Adult;
import doujian.model.Host;
import doujian.model.Student;
import doujian.util.Log;

/**
 * 性别的匹配
 * 
 * Created by Majie on 2017/4/23.
 */
public class Sex {
	/**
	 * 性别匹配
	 *
	 * @param stu
	 * @param host
	 * @return
	 */
	public static boolean filter(Student stu, Host host) {
		boolean result = false;
		if (stu.sex == 0) {
			result = true;
		} else {
			for (Adult adult : host.adults) {
				if (adult.sex == 1) {
					result = true;
					break;
				}
			}
		}
		Log.d("Sex Filter: " + result);
		return result;
	}
}
